package com.wechat.order.controller.HomeController;

import com.wechat.order.exception.ResponseBankException;
import com.wechat.order.platform.redisConverAndSend.RedisHandler;
import com.wechat.order.util.ResultVOUtil;
import com.wechat.order.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;

/**
 * 页面分发中心，主页控制层
 * Created by zzy on 2017/12/21.
 */
@Controller
@RequestMapping("/")
public class homeController {


    @Autowired
    private RedisHandler redisHandler;

    @GetMapping(value = { "", "index" })
    public ModelAndView index(){

        return new ModelAndView("index/homeIndex");
    }

    @GetMapping(value = "zzy")
    @ResponseBody
    public ResultVO zzy(){
        redisHandler.sendMessage2Redis();
        return ResultVOUtil.success();
    }

}
